home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-08-05 | 4.6 KB | 138 lines | [TEXT/SPM ] |
- /* mac06©1997,98 by HNS/DSITRI hns@computer.org
- ** X11/Intrinsic.h
- */
-
- #pragma once
-
- #ifndef _XtIntrinsic_h
- #define _XtIntrinsic_h
-
- #include "stdio.h"
- #include "time.h"
- #include "string.h"
-
- #ifndef NULL
- #define NULL 0
- #endif
- #ifndef TRUE
- #define TRUE 1
- #endif
- #ifndef FALSE
- #define FALSE 0
- #endif
-
- typedef char Boolean;
- typedef unsigned int Cardinal;
- typedef char *String;
- typedef void *XtPointer;
-
- struct XtInputId; /* added to avoid some warnings */
-
- typedef void (*XtInputCallbackProc)(XtPointer client_data, int *source, struct XtInputId **id);
-
- typedef struct XtInputId
- {
- int source;
- int *condition;
- int mask;
- int indx;
- XtInputCallbackProc proc;
- XtPointer client_data;
- struct XtInputId *next;
- } *XtInputId;
-
- struct XtIntervalId;
-
- typedef void (*XtTimerCallbackProc)(XtPointer client_data, struct XtIntervalId **id);
-
- typedef struct XtIntervalId
- {
- struct timeval interval;
- XtTimerCallbackProc proc;
- XtPointer client_data;
- struct XtIntervalId *next;
- } *XtIntervalId;
-
- typedef Boolean (*XtWorkProc)(XtPointer client_data);
-
- typedef struct XtWorkProcId
- {
- XtWorkProc proc;
- XtPointer client_data;
- struct XtWorkProcId *next;
- } *XtWorkProcId;
-
- #define XtInputNoneMask ((void *) 0)
- #define XtInputReadMask ((void *) 1)
- #define XtInputWriteMask ((void *) 2)
- #define XtInputExceptMask ((void *) 4)
-
- extern Boolean XtMemSummary; /* trace XtMalloc(), XtFree() etc. */
- extern Boolean XtMemCheck; /* add checking routines to XtMalloc(), XtFree() etc. */
-
- typedef void *XtAppContext;
- extern XtAppContext XtCurrentApp;
-
- void XtAppMainLoop(XtAppContext a);
- #define XtMainLoop() XtAppMainLoop(XtCurrentApp)
-
- XtInputId XtAppAddInput(XtAppContext a, int source, XtPointer condition, XtInputCallbackProc proc, XtPointer client_data);
- #define XtAddInput(s, c, p, cd) XtAppAddInput(XtCurrentApp, s, c, p, cd)
- void XtAppRemoveInput(XtAppContext a, XtInputId id);
- #define XtRemoveInput(id) XtAppRemoveInput(XtCurrentApp, id)
-
- XtIntervalId XtAppAddTimeOut(XtAppContext a, unsigned long interval, XtTimerCallbackProc proc, XtPointer client_data);
- #define XtAddTimeOut(i, p, cd) XtAppAddTimeOut(XtCurrentApp, i, p, cd)
- void XtAppRemoveTimeOut(XtAppContext a, XtIntervalId id);
- #define XtRemoveTimeOut(id) XtAppRemoveTimeOut(XtCurrentApp, id)
-
- XtWorkProcId XtAppAddWorkProc(XtAppContext a, XtWorkProc proc, XtPointer client_data);
- #define XtAddWorkProc(p, cd) XtAppAddWorkProc(XtCurrentApp, p, cd)
- void XtAppRemoveWorkProc(XtAppContext a, XtWorkProcId id);
- #define XtRemoveWorkProc(id) XtAppRemoveWorkProc(XtCurrentApp, id)
-
- char *XtMalloc(Cardinal size);
- #define XtCalloc(num, size) ((char *) memset((void *) XtMalloc(num*size), 0, num*size))
- char *XtRealloc(char *ptr, Cardinal num);
- void XtFree(char *ptr);
-
- void XtPrintMallinfo(String s);
-
- #define XtNew(TYPE) ((TYPE *) XtMalloc(sizeof(TYPE)))
- #define XtNewString(S) ((S)==NULL ? NULL : strcpy(XtMalloc((Cardinal)strlen(S)+1), (S)))
-
- typedef XtPointer Widget;
- typedef XtPointer WidgetClass;
- typedef String ResourceName;
- typedef XtPointer Resource;
- typedef String ResourceType;
-
- void XtAppInitialize(XtAppContext a);
- #define XtInitialize() XtAppInitialize(XtCurrentApp)
- Widget XtAppCreateWidget(XtAppContext a, char *name, WidgetClass c, Widget parent);
- #define XtCreateWidget(c, p) XtAppCreateWidget(XtCurrentApp, c, p)
- void XtAppDestroyWidget(XtAppContext a, Widget w);
- #define XtDestroyWidget(w) XtAppDestroyWidget(XtCurrentApp, w)
- int XtAppAddResource(XtAppContext a, Widget w, ResourceName r, ResourceType type);
- #define XtAddResource(w, r, type) XtAppAddResource(XtCurrentApp, w, r, type)
- int XtAppRemoveResource(XtAppContext a, Widget w, ResourceName r);
- #define XtRemoveResource(w, r) XtAppRemoveResource(XtCurrentApp, w, r)
- Resource XtAppLookupResource(XtAppContext a, Widget w, ResourceName r);
- int XtAppSetValue(XtAppContext a, Widget w, ResourceName r, XtPointer v);
- #define XtSetValue(w, r, v) XtAppSetValue(XtCurrentApp, w, r, v)
- int XtAppGetValue(XtAppContext a, Widget w, ResourceName r, XtPointer v);
- #define XtGetValue(w, r, v) XtAppGetValue(XtCurrentApp, w, r, v)
-
- typedef Boolean (*XtWidgetCallback)(Widget w, ResourceName r, XtPointer call_data, XtPointer client_data);
-
- int XtAppAddCallback(XtAppContext a, Widget w, ResourceName r, XtWidgetCallback cb, XtPointer client_data);
- #define XtAddCallback(w, r, cb, cd) XtAppAddCallback(XtCurrentApp, w, r, cb, cd)
- int XtAppRemoveCallback(XtAppContext a, Widget w, ResourceName r, XtWidgetCallback cb, XtPointer client_data);
- #define XtRemoveCallback(w, r, cb, cd) XtAppRemoveCallback(XtCurrentApp, w, r, cb, cd)
- int XtAppCallCallback(XtAppContext a, Widget w, ResourceName r, XtPointer call_data);
- #define XtCallCallback(w, r, cd) XtAppCallCallback(XtCurrentApp, w, r, cd)
-
- #endif /* _XtIntrinsic_h */
-
- /* EOF */
-